﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Forms.Design;
using System.Drawing.Design;

namespace Net.TheBoredCoders.SoundBoard
{
    /// <summary>Class to link the App-Settings to a Property-Grid</summary>
    [DefaultPropertyAttribute("TabRootFolderName")]
    class AppSettings
    {

        /// <summary>Gets or sets the tab-name of the root folder.</summary>
        /// <value>
        /// The name of the tab-root folder.
        /// </value>
        [Browsable(true)]
        [CategoryAttribute("Basic Settings"), DescriptionAttribute("The name of the main tab\n(requires restart / reload)")]
        public string TabRootFolderName
        {
            get { return Properties.Settings.Default.Label_RootDir; }
            set { Properties.Settings.Default.Label_RootDir = value; }
        }

        /// <summary>Gets or sets the button font.</summary>
        /// <value>
        /// The button font.
        /// </value>
        [Browsable(true)]
        [CategoryAttribute("Button Settings"), DescriptionAttribute("The font for the buttons\n(requires restart / reload)")]
        public System.Drawing.Font ButtonFont
        {
            get { return Properties.Settings.Default.Button_Font; }
            set { Properties.Settings.Default.Button_Font = value; }
        }

        /// <summary>Gets or sets the size of a button.</summary>
        /// <value>
        /// The size of a button.
        /// </value>
        [Browsable(true)]
        [CategoryAttribute("Button Settings"), DescriptionAttribute("The size for the buttons\n(requires restart / reload)")]
        public System.Drawing.Size ButtonSize
        {
            get { return Properties.Settings.Default.Button_Size; }
            set { Properties.Settings.Default.Button_Size = value; }
        }

        [Browsable(true)]
        [CategoryAttribute("Basic Settings"), DescriptionAttribute("Show confirm dialog on close")]
        public bool ConfirmExit
        {
            get { return Properties.Settings.Default.App_ConfirmClose; }
            set { Properties.Settings.Default.App_ConfirmClose = value; }
        }

        [Browsable(true)]
        [CategoryAttribute("Auto Spacing"), DescriptionAttribute("Replace underscores in filenames with spaces\n(requires restart / reload)")]
        public bool ReplaceUnderscoresWithSpaces
        {
            get { return Properties.Settings.Default.ReWrite_Underscores; }
            set { Properties.Settings.Default.ReWrite_Underscores = value; }
        }

        [Browsable(true)]
        [CategoryAttribute("Auto Spacing"), DescriptionAttribute("Insert a space in front of every capital letter of a filename\n(requires restart / reload)")]
        public bool InsertSpacesBeforeCapitalLetters
        {
            get { return Properties.Settings.Default.ReWrite_ByCapitalLetter; }
            set { Properties.Settings.Default.ReWrite_ByCapitalLetter = value; }
        }

        [Browsable(true)]
        [CategoryAttribute("Samples Data"), DescriptionAttribute("Change the location of the directory containing the samples\n(requires restart / reload)")]
        [EditorAttribute(typeof(FolderNameEditor), typeof(UITypeEditor))]
        public string SamplesDirectory
        {
            get { return Properties.Settings.Default.Path_Content; }
            set { Properties.Settings.Default.Path_Content = value; }
        }

    }
}